package com.ruoyi.base.domain;

import java.util.Date;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 学期对象 base_semster
 * 
 * @author yepanpan
 * @date 2020-11-09
 */
@ApiModel("学期实体")
@Getter
@Setter
public class BaseSemster extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增长主键ID */
    private Long id;

    /** 代码 */
    @Excel(name = "代码")
    @ApiModelProperty("代码")
    @NotBlank(message="代码不能为空")
    private String code;

    /** 名称 */
    @Excel(name = "名称")
    @ApiModelProperty("名称")
    @NotBlank(message="名称不能为空")
    private String title;

    /** 年度 */
    @Excel(name = "年度")
    @ApiModelProperty("年度")
    @NotBlank(message="年度不能为空")
    @Min(value = 2020, message = "年度不合法")
    @Max(value = 2099, message = "年度不合法")
    private Integer year;

    /** 开始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("开始日期")
    @NotNull(message="开始日期不能为空")
    private Date startDate;

    /** 结束日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("结束日期")
    @NotNull(message="结束日期不能为空")
    private Date endDate;

    /** 是否当前 */
    @Excel(name = "是否当前", dictType = "sys_yes_no")
    @ApiModelProperty("是否当前")
    private String isCurrent;

    /** 状态 */
    @Excel(name = "状态", dictType = "common_status")
    @ApiModelProperty("状态")
    @NotBlank(message="状态不能为空")
    private String status;

 
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("code", getCode())
            .append("title", getTitle())
            .append("year", getYear())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("isCurrent", getIsCurrent())
            .append("status", getStatus())
            .toString();
    }
}
